ActiveReports 12
Composite Charts
ActiveReports 12 > ActiveReports User Guide > Samples and Walkthroughs > Walkthroughs > Page Report/RDL Report Walkthroughs > Chart > Composite Charts

You can create Page and RDL reports with composite charts using the ActiveReports Chart data region. A composite chart consists of two or more series plotted along the Y-axis, where each series can display a different chart type. In ActiveReports, a composite chart may have up to six Y-axis series. You can combine the following chart types:

This walkthrough illustrates a step-by-step implementation for creating a composite chart with three Y-axis series. The walkthrough is split into the following activities:

Note:

When you complete this walkthrough you get a layout that looks similar to the following at design time and at run time.

Design-Time Layout

Run-Time Layout

To create an ActiveReports project in Visual Studio

  1. Create a new Visual Studio project.
  2. In the New Project dialog that appears, select ActiveReports 12 Page Report Application and in the Name field, rename the file as rptCompositeChart.
  3. Click OK to create a new ActiveReports 12 Page Report Application. By default a Page report is added to the project.

See Adding an ActiveReport to a Project for information on adding different report layouts.

To connect the report to a data source

  1. In the Report Explorer, right-click the Data Sources node and select the Add Data Source option or select Data Source from the Add button.
  2. In the Report Data Source Dialog that appears, select the General page and in the Name field, enter a name like ChartData.
  3. On this page, create a connection to the Reels database. See Connect to a Data Source for information on connecting to a data source.

To add a dataset

  1. In the Report Explorer, right-click the ChartData data source node and select the Add Data Set option or select Data Set from the Add button.
  2. In the DataSet Dialog that appears, select the General page and enter the name of the dataset as StoreSummaryData.
  3. On the Query page of this dialog, in the Query field enter the following SQL query.
    SQL Query
    Copy Code
    SELECT * from StoreSummary
    
  4. Click the Validate DataSet icon  at the top right hand corner above the Query box to validate the query.
  5. Click OK to close the dialog. Your data set and queried fields appear as child nodes to the data source in the Report Explorer.

To add the chart data region with data to the report

  1. In the Report Explorer, select Report and in the Properties Window, set the PaperOrientation property to Landscape.
  2. From the toolbox, drag a Chart data region onto the design surface of the report.
  3. In the Select a Chart Type wizard that appears, select the chart type as Column and go to the Properties Window to set the following properties.

    Property Name Property Value
    Location 0in, 0in
    Size 7.5in, 4.5in
  4. Double-click inside the chart area to display the chart panes along the top, right, and bottom of the chart to drop fields in.
  5. From the Report Explorer, drag the StoreName field into the area below the chart labeled "Drop category fields here." This automatically binds the StoreName field to the X-axis.

  6. Select the chart and at the bottom of Properties Window, select the Chart Y-Axis command.
  7. In the Y-axis dialog that appears, under the Title tab, set the Y-Axis title property to Gross Sales.
  8. Click Add to add the second Y-Axis. Set the Y-Axis title property to Gross Profit and the Margin property to 0.8in.
  9. Click Add to add the third Y-Axis. Set the Y-Axis title property to Total Items and the Position property to Right.
  10. Click OK to close the dialog.
  11. Select the chart and from the bottom of the Properties Window, select the Chart data command.
  12. Select the Series Values page. Click Add to add the first Y-axis series and set the properties as follows.

     

    Property Name Property Value
    Series label Gross Sales
    Value =[GrossSales]
    Chart Type Area Plain
    Y-Axis Y1
  13. Click Add to add the second Y-axis series and set the properties as follows.

    Property Name Property Value
    Series label Gross Profit
    Value =[GrossProfit]
    Chart Type Line Plain
    Y-Axis Y2
  14. Click Add to add the third Y-axis series and set the properties as follows.

    Property Name Property Value
    Series label Total Items
    Value =[TotalItems]
    Chart Type Column Plain
    Y-Axis Y3
  15. Click OK to close the dialog.

To configure the appearance of the chart

  1. Select the chart and at the bottom of Properties Window, select the Chart appearance command.
  2. In the Chart Appearance dialog that appears, on the Title page enter Store Summary in the Chart title field.
  3. In the Palette page, open the Palette drop-down, and select Pastel.
  4. Click OK to close the dialog.
  5. Select the chart and at the bottom of the Properties Window, select the Chart X-Axis command.
  6. In the Chart X-Axis - Title dialog that appears set the properties as follows.

    Property Name Property Value
    X-Axis title Store Name
    Size 6pt
  7. Click OK to close the dialog.
  8. Select the chart and at the bottom of the Properties Window, select the Chart Y-Axis command.
  9. Select Y1 from the list of Y-axes and under the Labels tab, select the Show y-axis labels check box. Also, select Currency from the Format code drop-down.
  10. Repeat the above step for Y2.
  11. Select Y3 from the list of Y-axes and under the Labels tab, select the Show y-axis labels check box.
  12. Click OK to close the dialog.

 To view the report

OR

See Also